package com.amoby.main.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class SysUsers implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer           userId;
    private String            nick;
    private String            username;
    @JsonIgnore
    private String            password;
    private String            email;
    private Integer           status;
    private Date              updateDate;
    private Date              createDate;
    private List<SysRoles>    roles;
    private List<SysMenus>    menus;
    private String            channleNames;
    private String            channelIds;
    private List<String>      pkeys;                // 登陆的时候 查询出 登陆的查看产品的权限 廖江红 2015-1-28
    private Long              qq;                   // 2015-3-4廖江红 添加用户信息qq
    private String            phone;                // 2015-3-4廖江红 添加用户信息电话
    private String            userType;             // 用户类型 2016-4-11 陈杨昆

    public Long getQq() {
        return qq;
    }

    public void setQq(Long qq) {
        this.qq = qq;
    }

    public List<String> getPkeys() {
        return pkeys;
    }

    public void setPkeys(List<String> pkeys) {
        pkeys.add("initdefault");
        this.pkeys = pkeys;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick == null ? null : nick.trim();
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public List<SysRoles> getRoles() {
        return roles;
    }

    public void setRoles(List<SysRoles> roles) {
        this.roles = roles;
    }

    public List<SysMenus> getMenus() {
        return menus;
    }

    public void setMenus(List<SysMenus> menus) {
        this.menus = menus;
    }

    /**
     * 获取用户的角色编号
     * 
     * @author 吴尚云
     * @date 2014-3-3 下午4:47:56
     * @return
     */
    public Integer getRoleId() {
        if (roles != null && roles.size() > 0) {
            return roles.get(0).getRoleId();
        }
        return null;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * 获取用户的上级角色
     * 
     * @author 吴尚云
     * @date 2014-3-3 下午5:53:36
     * @return
     */
    public Integer getParentRole() {
        if (roles != null && roles.size() > 0) {
            return roles.get(0).getParentRole();
        }
        return null;
    }

    public String getChannleNames() {
        return channleNames;
    }

    public void setChannleNames(String channleNames) {
        this.channleNames = channleNames;
    }

    public String getChannelIds() {
        return channelIds;
    }

    public void setChannelIds(String channelIds) {
        this.channelIds = channelIds;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    @Override
    public String toString() {
        return "SysUsers [userId=" + userId + ", nick=" + nick + ", username=" + username + ", password=" + password + ", email=" + email
                + ", status=" + status + ", updateDate=" + updateDate + ", createDate=" + createDate + ", roles=" + roles + ", menus=" + menus
                + ", channleNames=" + channleNames + ", channelIds=" + channelIds + ", pkeys=" + pkeys + ", qq=" + qq + ", phone=" + phone
                + ", userType=" + userType + "]";
    }
}
